// count_student.cpp -- 统计所有学生数量
#include "../include/student_score_system.h"
#include <iostream>

void countStudent(const System *sys)
{
    system("cls");
    using std::cout;
    using std::endl;
    std::string 男;
    std::string 女;
    cout << "===================================================" << endl;
    cout << "*                   统计学生个数                  *" << endl;
    cout << "===================================================" << endl;
    int man_num = 0;
    int woman_num = 0;
    for (int i = 0; i < sys->num; i++)
    {
        if (sys->stu[i].sex_ == 1)
            man_num++;
        else
            woman_num++;
    }
    int all_num  = man_num + woman_num;
    cout << "当前系统中录入学生数量如下: " << endl;
    cout << "男: " << man_num << "人" << endl;
    cout << "女: " << woman_num << "人" << endl;
    cout << "总人数: " << all_num << "人" << endl;
    system("pause");
    system("cls");
    showMenu();
    selectOption();
}